package com.riddle.service;

import java.util.List;

import com.riddle.dao.BaseDao;
import com.riddle.model.Menu;

public abstract class BaseService <T> {

	protected abstract BaseDao getDao();
	
	public List<T> queryParent(){
		return getDao().queryParent();
	}
	
	public List<T> queryModelByPage(Integer page, Integer rows, String query){
		return getDao().queryModelByPage(page, rows, query);
	}
	
	public T query(Long id){
		return (T) getDao().query(id);
	}
	
	public void insert(T t) {
		getDao().insert(t);
	}
	
	public void update(T t) {
		getDao().update(t);
	}
	
	public void delete(Long id) {
		getDao().delete(id);
	}
}
